<?php
class sysadminManager extends BaseModule{
	public function __construct(){
		parent::__construct();
	}
	
	public function writeDomainConfigFile($siteHeader){
		$re_str .='<?php'."\r\n";
		$re_str .='/**'."\r\n";
		$re_str .='* 网站域名配置'."\r\n";
		$re_str .='*'."\r\n";
		$re_str .='*/'."\r\n";
		
		$re_str .= "define('HTTPFILEURL', '{$siteHeader}'); "."\r\n";
		$re_str .= '?>'."\r\n";
		
		
		$filename = DATA_PATH.'sysadminConfig.class.php';
		if (is_writable($filename)) {
			if (!$handle = fopen($filename, 'w')) {
				return "不能打开文件 $filename";
			}
			if (fwrite($handle, $re_str) === FALSE) {
				return "不能写入到文件 $filename";
			}
			fclose($handle);
			return "成功地写入到文件";
		} else {
			return "文件 $filename 不可写";
		}
	}
}